<p class="Head1"><help:paragraphinfo state="U" number="1"/><help:key-word value="CBool; function" tag="kw66608_1"/><help:link Id="66608">CBool Function [Runtime]</help:link></p>
<p class="Paragraph"><help:paragraphinfo state="U" number="2"/>Converts a string comparison or numeric comparison to a Boolean expression, or converts a single numeric expression to a Boolean expression.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="8" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Expression1, Expression2:</span> Any string or numeric expressions that you want to compare. If the expressions match, the <span class="T1">CBool</span> function returns <span class="T1">True</span>, otherwise <span class="T1">False</span> is returned.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="9" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Number:</span> Any numeric expression that you want to convert. If the expression equals 0, <span class="T1">False</span> is returned, otherwise <span class="T1">True</span> is returned.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="10" xmlns:help="http://openoffice.org/2000/help"/>The following example uses the <span class="T1">CBool</span> function to evaluate the value that is returned by the <span class="T1">Instr</span> function. The function checks if the word "and" is found in the sentence that was entered by the user.</p>
<p class="PropText"><help:paragraphinfo state="U" number="13" xmlns:help="http://openoffice.org/2000/help"/>Dim sText As String</p>
<p class="PropText"><help:paragraphinfo state="U" number="14" xmlns:help="http://openoffice.org/2000/help"/>sText = InputBox("Please enter a short sentence:")</p>
<p class="PropText"><help:paragraphinfo state="U" number="15" xmlns:help="http://openoffice.org/2000/help"/>REM Proof if the word »and« appears in the sentence.</p>
<p class="PropText"><help:paragraphinfo state="U" number="16" xmlns:help="http://openoffice.org/2000/help"/>REM Instead of the command line</p>
<p class="PropText"><help:paragraphinfo state="U" number="18" xmlns:help="http://openoffice.org/2000/help"/>REM the CBool function is applied as follows:</p>
<p class="PropText"><help:paragraphinfo state="U" number="20" xmlns:help="http://openoffice.org/2000/help"/>MsgBox "The word »and« appears in the sentence you entered!"</p>